STEP 12: Now let's calculate the area of the triangle.

In Python we use a forward slash / to show division. Remember, we use an asterisk * for multiplication.

  • Make the value of triangle_area equal to triangle_width * triangle_height / 2.
  • This is the same as using the formula area = base x height ÷ 2.


To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)